package com.jack.service;

import java.util.Map;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.jack.configuration.FeignLogConfiguration;
import com.jack.entity.User;

@FeignClient(name = "microservice-provider-user", configuration=FeignLogConfiguration.class)
public interface UserFeignClient {

	@RequestMapping(value  = "/{id}", method = RequestMethod.GET)
	public User findById(@PathVariable("id") Long id);
	
	@RequestMapping(value = "/post", method = RequestMethod.POST)
	public User post(@RequestBody User user);
	
	//TODO  convert value of type 'java.lang.String' to required type 'java.lang.Long'
	@RequestMapping(value  = "/get1", method = RequestMethod.GET)
	public User get1(@RequestParam("id") Long id, @RequestParam("name") String name);
	
//	@RequestMapping(value  = "/get2", method = RequestMethod.GET)
//	public User get2(@RequestParam Map<String, Object> map);
}
